<template slot-scope="scope">
  <el-select v-model="selection" placeholder="请选择类型">
    <el-option v-for="(type, index) in types" :key="index" :label="type.label" :value="type.value"></el-option>
  </el-select>
</template>
<script>
export default {
  model: {
    prop: "value",
    event: "selected"
  },
  props:{
    value: {
      type: String,
      default: 'System.String'
    },
  },
  data() {
    return {
      types: [
        {
          value: 'System.Boolean',
          label: 'Boolean'
        },
        {
          value: 'System.Char',
          label: 'Char'
        },
        {
          value: 'System.SByte',
          label: 'SByte'
        },
        {
          value: 'System.Byte',
          label: 'Byte'
        },
        {
          value: 'System.Int16',
          label: 'Int16'
        },
        {
          value: 'System.UInt16',
          label: 'UInt16'
        },
        {
          value: 'System.Int32',
          label: 'Int32'
        },
        {
          value: 'System.UInt32',
          label: 'UInt32'
        },
        {
          value: 'System.Int64',
          label: 'Int64'
        },
        {
          value: 'System.UInt64',
          label: 'UInt64'
        },
        {
          value: 'System.Single',
          label: 'Single'
        },
        {
          value: 'System.Double',
          label: 'Double'
        },
        {
          value: 'System.Decimal',
          label: 'Decimal'
        },
        {
          value: 'System.DateTime',
          label: 'DateTime'
        },
        {
          value: 'System.DateTimeOffset',
          label: 'DateTimeOffset'
        },
        {
          value: 'System.String',
          label: 'String'
        }
      ]
    }
  },
  computed: {
    selection: {
      get(){
        return this.value;
      },
      set(val){
        this.$emit('selected', val);
      }
    }
  },
}
</script>